<script type="text/javascript" src="<?php echo base_url('assets/tiny_mce/tiny_mce.js');?>"></script>
<div class="container">
    <div class="page-title ui-widget-content ui-corner-all head">
	    <div class="headLeft">
        	<h1 class="icon-48-category-add">Category Manager</h1>
        </div>
    	<div class="headRight">
       		<div id="toolbar" class="toolbar-list">
            	<ul>
                    <li id="toolbar-new" class="button">
                    	<a class="toolbar"  href="<?php echo base_url('admin/category/add') ?>"><span class="icon-32-new"></span>&nbsp;&nbsp;New</a>
                    </li>
                    <li id="toolbar-edit" class="button">
                    	<a class="toolbar" href="#"><span class="icon-32-edit"></span>&nbsp;&nbsp;Edit</a>
                    </li>

                     <li id="toolbar-trash" class="button">
						<a class="toolbar" href="#"><span class="icon-32-trash"></span>&nbsp;&nbsp;Trash</a>
					</li>
					<li id="toolbar-publish" class="button">
	                    <a class="toolbar" href="#"><span class="icon-32-publish"></span>&nbsp;&nbsp;Publish</a>
            	     </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="hastables">
        <div class="detail-post-add clearfix">
        	<?php echo form_open('cp/article/add',array('class' => 'myform', 'id' => 'myform')); ?>

				<table cellpadding="0" cellspacing="0" width="100%" border="0">
                	<tr>
                    	<td height="25" width="120">Tiêu đề:</td>
                        <td><input type="text" name="title" value="" class="input" />
                        	<label class="errors"><?php echo form_error('title'); ?></label>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" width="120">Alias:</td>
                        <td><input type="text" name="alias" value="" class="input" />
                            <label class="errors"><?php echo form_error('alias'); ?></label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            Nội dung:<br>
                        	<textarea class="textarea" name="content"></textarea>
                        </td>
                    </tr>
                    <tr>
                    	<td></td>
                        <td height="30"><input type="submit" name="submit" value="Submit" /></td>
                    </tr>
                </table>
				<?php echo form_close(); ?>
        </div>
    </div>
</div>
<script type="text/javascript">
	jQuery(document).ready(function(){
		jQuery('#parent').change(function(){
			var id = jQuery('select#parent option:selected').val();
			if(id>0){

				 	var option ="<option value='need'>Need</option>";
					option+="<option value='type'>Type</option>";
					jQuery('#type').html(option);
			}else {
				 var option = "<option value='category'>Category</option>";
				 jQuery('#type').html(option);
			}

		});

	});

    tinyMCE.init({
        mode : "textareas",
        relative_urls : false,
        remove_script_host : false,
        document_base_url :base_url,
        theme : "advanced",
        valid_elements : "@[id|style|title|dir<ltr?rtl|lang|"+ "onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|"
                + "onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|"
                + "name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,"
                + "#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|"
                + "src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,"
                + "-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|"
                + "height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|"
                + "height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,"
                + "#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor"
                + "|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,"
                + "-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face"
                + "|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],"
                + "object[classid|width|height|*],param[name|value|_value],embed[type|width"
                + "|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,"
                + "button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|"
                + "valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],"
                + "input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],"
                + "kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],"
                + "q[cite],samp,select[disabled|multiple|name|size],small,"
                + "textarea[cols|rows|disabled|name|readonly],tt,var,big",


        height: "500px",
        width:"70%",
        plugins : "paste,inlinepopups",
        theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist",
        theme_advanced_buttons2:"",
        theme_advanced_buttons3:"",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_font_sizes : "3,4,5,6",
        theme_advanced_fonts : "Arial=arial;Verdana=verdana;Times New Roman=times new roman;Tahoma=tahoma",
        entity_encoding : "raw",
        language : 'vi',
        theme_advanced_buttons1_add : "fontselect,fontsizeselect,forecolor,backcolor,separator,link,unlink,pasteword,removeformat",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        //theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",

        theme_advanced_path_location : "bottom",
        theme_advanced_path : false,
        theme_advanced_resize_horizontal : false,
        theme_advanced_resizing : true,
        forced_root_block : false,
        //force_br_newlines : true,
        force_p_newlines : true,
        apply_source_formatting : true
    });
</script>
